package com.bbva.general.controller;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.context.ContextLoader;
import org.springframework.web.context.WebApplicationContext;

/**
 * Servlet implementation class MensajeTablaGeneral
 */
public class MensajeTablaGeneral extends HttpServlet {
	private static final long serialVersionUID = 1L;
    public AdminCargaController admCargaController;
    /**
     * @see HttpServlet#HttpServlet()
     */
    public MensajeTablaGeneral() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		WebApplicationContext applicationContext = ContextLoader.getCurrentWebApplicationContext();
        admCargaController = (AdminCargaController) applicationContext.getBean("adminCargaController");
        String mensaje = admCargaController.contrastarCargaEstaticaDinamica();
        PrintWriter out;
        response.setContentType("charset=utf-8");
        out = response.getWriter();
        out.println(mensaje);
        
	}
	

}
